<!DOCTYPE html >
<html>
<head>
<meta name="Generator" content="TPshop v1.1" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>我的信息</title>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<!-- <link rel="stylesheet" href="__ROOT__ /AI_radar/css/footer.css"> -->
<link rel="stylesheet" href="__ROOT__ /AI_radar/css/font_my/iconfont.css">
<!--  <link rel="stylesheet" href="__ROOT__ /AI_radar/plug_in/site/css/LArea.css"> -->
<link rel="stylesheet" href="__ROOT__ /AI_radar/css//my/message.css">
<script type="text/javascript" src="__ROOT__ /AI_radar/js/token.js"></script>

<!-- <style type="text/css">
	body,html{
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
		overflow-x: hidden;
		color:#555555;
		background: #fff;
	}
	p{
		margin:0;
	}
	.head{
		width: calc(100% - 20px);
		line-height: 50px;
		background: #ddd;
		padding: 0 10px;
		font-size: 18px;
		font-weight: bold;
	}
	.messageB{
		width: calc(100% - 20px);
		padding: 0 10px;
		font-size: 16px;
		background: #fff;
	}
	.messageOne{
		width: calc(100% - 20px-);
		display: flex;
		line-height: 30px;
		padding: 10px;
		border-bottom: 1px solid #eaeaea;
	}
	.messageOneL,.messageOneLI{
		width: 60px;
		font-weight: bold;
	}
	.messageOneC{
		width: calc(100% - 75px);

	}
	.messageOneR{
		width: 15px;
		color:#666666;
	}
	input{
		outline: none;
		border:none;
		width: 100%;
	}
	textarea{
		width: 100%;
		height: 60px;
		resize: none;
		border:none;
	}
	.messageBao{
		width: 100%;
		margin: 30px 0;
		line-height: 45px;
		text-align: center;
		color: #fff;
		background: #4f81d4;
	}
	.messageOneI{
		width: 100%;
		display: flex;
		padding: 10px 0;
		border-bottom: 1px solid #eaeaea;
	}
	
	.messageOneLI{
		line-height: 50px;
	}
	.messageImg{
		width:50px;
		height: 50px; 
	}
	.messageOneCI{
		width: calc(100% - 140px);
	}
	.messageOneRI{
		width: 80px;
		padding-top: 20px;
	}
	.file-input {
        display: inline-block;
        box-sizing: border-box;
        width: 16px;
        width: 80px;
        height: 30px;
        opacity: 0;
        cursor: pointer;
    }
    .select-button {
        color: #fff;
        position: absolute;
        width: 80px;
        height: 30px;
        text-align: center;
        background: #4f81d4;
        border: none;
  	}

    #select-button{
        margin:0;
        padding: 0;
    }
    .messageOneP{
		width: calc(100% - 20px);
		padding: 10px 10px;
		display: flex;
		line-height: 30px;
		border-bottom: 1px solid #eaeaea;
		background: #fff;

	}

	.messageOneLP{
		width: calc(100% - 75px);
		font-weight: bold;
	}
	.messageOneRP{
		width: 75px;
		color:#666666;
	}
	/*按钮*/
	.testswitch {
	    position: relative;
	    float: left; 
	    width: 70px;
	    margin: 0;
	    -webkit-user-select:none; 
	    -moz-user-select:none; 
	    -ms-user-select: none;
	}
	 
	.testswitch-checkbox {
	    display: none;
	}
	 
	.testswitch-label {
	    display: block; 
	    overflow: hidden; 
	    cursor: pointer;
	    /*border: 2px solid #999999; */
	    border-radius: 20px;
	}
	 
	.testswitch-inner {
	    display: block; 
	    width: 200%; 
	    margin-left: -100%;
	    transition: margin 0.3s ease-in 0s;
	}
	 
	.testswitch-inner::before, .testswitch-inner::after {
	    display: block; 
	    float: right; 
	    width: 50%; 
	    height: 30px; 
	    padding: 0; 
	    line-height: 30px;
	    font-size: 14px; 
	    color: white; 
	    font-family: 
	    Trebuchet, Arial, sans-serif; 
	    font-weight: bold;
	    box-sizing: border-box;
	}
	 
	.testswitch-inner::after {
	    content: attr(data-on);
	    padding-left: 10px;
	    background-color: #4f81d4; 
	    color: #FFFFFF;
	}
	 
	.testswitch-inner::before {
	    content: attr(data-off);
	    padding-right: 10px;
	    background-color: #EEEEEE; 
	    color: #999999;
	    text-align: right;
	}
	 
	.testswitch-switch {
	    position: absolute; 
	    display: block; 
	    width: 30px;
	    height: 30px;
	    margin: 0px;
	    background: #eaeaea;
	    top: 0; 
	    bottom: 0;
	    right: 36px;
	    /*border: 2px solid #999999; */
	    border-radius: 20px;
	    transition: all 0.3s ease-in 0s;
	}
	 
	.testswitch-checkbox:checked + .testswitch-label .testswitch-inner {
	    margin-left: 0;
	}
	 
	.testswitch-checkbox:checked + .testswitch-label .testswitch-switch {
	    right: 0px; 
	}
	/*.tiP{
		font-size: 12px;
		line-height: 50px;
		color: red;
		text-indent: 10px;
	}*/


</style> -->
<style type="text/css">
	.bxxz{
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		left: 0;
		background: rgba(0,0,0,0.5);
		display: none;
	}
	.bxxzs{
		width: calc(80% - 20px);
		height: calc(80% - 20px);
		padding:10px;
		margin: 10%;
		background: #fff;
		border: 1px solid #fff;
		border-radius: 2px;
	}
	.bxxzOne{
		line-height: 30px;
		padding: 5px 0;
	}
	.tableBtm{
		width: 20px;
	}
	.bxxzTop{
		width: 100%;
		height: 40px;
		line-height: 40px;
		position: relative;
		text-align: center;
		border-bottom: 1px solid #ccc;
	}
	.bxxzGb{
		width: 30px;
		height: 30px;
		border-radius: 50%;
		position: absolute;
		top: 0px;
		right: 5px;
		line-height: 30px;
		border:1px solid #ccc;
	}
	.bxxzCen{
		width:100%;
		height: calc(100% - 85px);
		overflow-y: auto;
	}
	.bxxzBtm{
		width: 100%;
		height: 45px;
	}
	.bxxzBc{
		width: 80%;
		line-height: 30px;
		text-align: center;
		margin: 10px 10% 5px 10%;
		background: #4f81d4;
		color: #fff;
	}
</style>

</head>
<body>
	{include file="public/wx_share" /}
	<div class="message">
		<div class="head">个人信息</div>
<!-- 		<div class="messageOneP">
			<div class="messageOneLP">手机号在名片上显示</div>
			<div class="messageOneRP">
				<div class="testswitch">
					<input class="testswitch-checkbox" id="onoffswitch" type="checkbox">
					<label class="testswitch-label" for="onoffswitch">
						<span class="testswitch-inner" data-on="ON" data-off="OFF"></span>
						<span class="testswitch-switch"></span>
					</label>
				</div>
			</div>
		</div> -->
<!-- 		<div class="messageB">
			<div class="messageOneI">
				<div class="messageOneLI">头像</div>
				<div class="messageOneCI"><img src="__ROOT__ /AI_radar/image/my/tx.png" onerror="this.src='__ROOT__ /AI_radar/image/my/tx.png'" alt="" class="messageImg"></div>
				<div class="messageOneRI">
					<div class="mainContainer">
                        <form method="post" enctype="multipart/form-data" id="form" action="upload">
                          <div id="box2">
                            <button class="select-button" id="select-button" sid=''>选择头像</button>
                            <input class="file-input select2" type="file" id="inputImage" sid='' class="hidden" multiple="multiple"/>
                          </div>
                        </form>
                    </div>
				</div>
			</div> -->
			<div class="messageOne">
				<div class="messageOneL">手机</div>
				<div class="messageOneC"><input type="number" class="phonenum" placeholder="请填写"></div>
				<!-- <div class="messageOneC phone"></div> -->

				<div class="messageOneR"></div>
			</div>
			<div class="messageOne">
				<div class="messageOneL">微信</div>
				<div class="messageOneC"><input type="text" name="weixin" class="weixin" placeholder="请填写"></div>
				<div class="messageOneR"></div>
			</div>
			<div class="messageOne">
				<div class="messageOneL">班型</div>
				<div class="messageOneC oppen"><!-- <input type="text" name="email" class="email" placeholder="请填写"> -->
					<span class="collision">请选择班型</span>
					<!-- <select class="selectTop" id="selectTop" style="width: 80%">
						<option class="options" id="options" index='0'>选择班型</option>
						<option class="option" index="l">A1</option>
						<option class="option" index="2">A2</option>
						<option class="option" index="3">A1/A2</option>
						<option class="option" index="4">B1</option>
						<option class="option" index="5">B2</option>
						<option class="option" index="6">B1/B2</option>
						<option class="option" index="7">c1手动挡</option>
						<option class="option" index="8">C2自动挡</option>
						<option class="option" index="9">C</option>
						<option class="option" index="10">D/E/F</option>
icon-cha
			        </select> -->
				</div>
				<div class="messageOneR oppen"><i class='iconfont icon-arrow-right-copy'></i></div>
			</div>
			<div class="messageOne">
				<div class="messageOneL">公司</div>
				<!-- <div class="messageOneC"><input type="text" name="diqu" class="diqu" placeholder="地区信息" id="demo2" readonly="" ></div> -->
				<div class="messageOneC"><textarea name="company" id="" class="site company" placeholder="请填写"></textarea></div>

				<div class="messageOneR"></div>
			</div>
			<div class="messageOne">
				<div class="messageOneL">地址</div>
				<div class="messageOneC"><textarea name="address" id="" class="site address" placeholder="请填写"></textarea></div>
				<div class="messageOneR"></div>
			</div>
		</div>
		<div class="messageBao">保存</div>
	</div>
	<div class="bxxz">
		<div class="bxxzs">
			<div class="bxxzTop">选择班型
				<div class="bxxzGb"><i class='iconfont icon-cha'></i></div>
			</div>
			<div class="bxxzCen">
				<div class="bxxzOne">
		          <input type='checkbox' name='tableBtm' class='tableBtm' sid='A1'> <span>A1大型客车</span>
		        </div>
		        <div class="bxxzOne">
		          <input type='checkbox' name='tableBtm' class='tableBtm' sid='A2'> <span>A2牵引车</span>
		        </div>
		        <div class="bxxzOne">
		          <input type='checkbox' name='tableBtm' class='tableBtm' sid='A3'> <span>A3城市公交车</span>
		        </div>
		        <div class="bxxzOne">
		          <input type='checkbox' name='tableBtm' class='tableBtm' sid='B1'> <span>B1中型客车</span>
		        </div>
		        <div class="bxxzOne">
		          <input type='checkbox' name='tableBtm' class='tableBtm' sid='B2'> <span>B2大型货车</span>
		        </div>
		        <div class="bxxzOne">
		          <input type='checkbox' name='tableBtm' class='tableBtm' sid='C1'> <span>C1手动挡</span>
		        </div>
		        <div class="bxxzOne">
		          <input type='checkbox' name='tableBtm' class='tableBtm' sid='C2'> <span>C2自动挡</span>
		        </div>
		        <div class="bxxzOne">
		          <input type='checkbox' name='tableBtm' class='tableBtm' sid='D/E'> <span>D、E摩托车</span>
		        </div>
			</div>
			<div class="bxxzBtm">
				<div class="bxxzBc" onclick="bxxzBc()">确定</div>
			</div>
		</div>
	</div>
	<div class="CRM_log" style="display:block;position: fixed;top: 0;left: 0;background:rgba(0,0,0,0);width:100%;height: 100%;">
        <div style="width:100%;height:100%;display:flex;vertical-align: middle;">
          <div style="width:3rem;height:3rem;margin: auto;">
            <img src="http://resource.17jxyx.com/goods/15537572830000.gif" alt="" class="load1Img" style="width:100%;height:auto;border-radius: 0.4rem;background: rgba(255,255,255,0.3)" />
           <!--  <div class="loadFont" style='width:100%;text-align: center;display: block;color:#fff;font-size: 20px;'>正在加载...</div> -->
          </div>
        </div>
    </div>

<script src='__ROOT__ /AI_radar/js/jquery.js'></script>
<!-- <script src="__ROOT__ /AI_radar/plug_in/site/js/LAreaData1.js"></script>
<script src="__ROOT__ /AI_radar/plug_in/site/js/LAreaData2.js"></script>
<script src="__ROOT__ /AI_radar/plug_in/site/js/LArea.js"></script>
<script type="text/javascript" src='__ROOT__ /AI_radar/js/qiniu/qiniu.min.js'></script> -->
<script type="text/javascript">
	var classType='';

	$.ajax({
	      url:window.urls.url +"/my/message/info",
	      type:"POST",
	      contentType: "application/json",
	      dataType:"json",
	      data:JSON.stringify({
	        token:window.tokens.token_boss,
	      }),
	      success:function(res){
	        // console.log(res)
	        $(".CRM_log").css("display","none")
	        // console.log(res.data)
	        if(res.data){
	        	if(res.data.phone){
	        		$(".phonenum").val(res.data.phone)
	        	}
	        	if(res.data.wechat_num){
	        		$(".weixin").val(res.data.wechat_num)
	        	}
	        	if(res.data.email){
	        		
	        		$(".collision").html(res.data.email)
	        		classType = res.data.email
	        		// $("#selectTop option[index='0']").remove(); 
	        		// $("#selectTop").prepend("<option index='11'>"+res.data.email+"</option>"); 
	        		// $("#selectTop ").get(0).selectedIndex=0; 

	        		// $("#options").val(res.data.email)
	        	}
	        	if(res.data.company){
	        		$(".company").val(res.data.company)
	        	}
	        	if(res.data.address){
	        		$(".address").val(res.data.address)
	        	}
	        }
	    },
	    error:function(res){
	    	$(".CRM_log").css("display","none")
	        console.log(res)
	    }
  	})

  	$(".messageBao").click(function(){
  		var phone = $(".phonenum").val()
  		var weixin = $(".weixin").val()
  		// var email = $(".email").val()
  		var company = $(".company").val()
  		var address = $(".address").val()
  		// console.log($(".selectTop").val())
  		// if($(".selectTop").val() == "选择班型"){
  		// 	alert("请选择班型")
  		// 	return false;
  		// }
  		if(classType == ""){
  			alert("请选择班型")
  			return false;
  		}
  		$(".CRM_log").css("display","block")
  		// console.log(weixin,classType,company,address,phone)
  		// console.log(window.tokens.token_boss)

  		$.ajax({
		      url:window.urls.url +"/my/message/update",
		      type:"POST",
		      contentType: "application/json",
		      dataType:"json",
		      data:JSON.stringify({
		        token:window.tokens.token_boss,
		        wechat_num:weixin,
		        email:classType,
		        company:company,
		        address:address,
		        phone:phone
		      }),
		      success:function(res){
		      	$(".CRM_log").css("display","none")
		        // console.log(res)
		        // console.log(res.data)
		        if(res.data == 1){
		        	alert("修改信息成功")
		        }else{
		        	alert("修改信息失败，请重新修改")
		        }
		        window.history.go(-1)
		        // window.location.href=window.urls.url +`/my/oneself?corpid=${localStorage.getItem("CRM_corpId")}`
		    },
		    error:function(res){
		        // console.log(res)
		        $(".CRM_log").css("display","none")
		        alert("修改信息失败")
		        window.history.go(-1)
		    }
	  	})

  	})
  	//关闭弹框
  	$(".bxxzGb").click(function(){
  		$(".bxxz").css("display","none")
  	})
  	//打开弹框
  	$(".oppen").click(function(){
  		// console.log(classType)
  		$(".bxxz").css("display","block")
  	})
  	//获取班型
	function bxxzBc(){
		var tableBott = document.querySelectorAll('.tableBtm');
		var str = ''
		// var numbers = 0
	    Array.from(tableBott).forEach(function(a,b){
	    	if(a.checked){
	    		if(str == ''){
	    			// numbers++
	    			str = a.getAttribute("sid")
	    		}else{
	    			// numbers++
	    			str = str + ',' + a.getAttribute("sid")
	    		}
	    	}
	    })
	    // if(numbers>5||numbers<1){
	    // 	alert("最少选择1个班型，且不能超过5个班型")
	    // }else{

		    classType = str
		    // console.log(classType)
		    $(".collision").html(classType)
		    $(".bxxz").css("display","none")
	    // }
	}


	
	// console.log($)
	// var area2 = new LArea();
 //    area2.init({
 //        'trigger': '#demo2',
 //        'valueTo': '#value2',
 //        'keys': {
 //            id: 'value',
 //            name: 'text'
 //        },
 //        'type': 2,
 //        'data': [provs_data, citys_data, dists_data]
 //    });



</script>
</body>
</html>